package com.xmj.ms.service.impl;

import com.xmj.ms.domain.Barbers;
import com.xmj.ms.mapper.BarbersMapper;
import com.xmj.ms.service.IBarbersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 员工Service业务层处理
 *
 * @author ohh
 * @date 2024-04-21
 */
@Service
public class BarbersServiceImpl implements IBarbersService
{
    @Autowired
    private BarbersMapper barbersMapper;

    /**
     * 查询员工
     *
     * @param barberID 员工主键
     * @return 员工
     */
    @Override
    public Barbers selectBarbersByBarberID(Long barberID)
    {
        return barbersMapper.selectBarbersByBarberID(barberID);
    }

    /**
     * 查询员工列表
     *
     * @param barbers 员工
     * @return 员工
     */
    @Override
    public List<Barbers> selectBarbersList(Barbers barbers)
    {
        return barbersMapper.selectBarbersList(barbers);
    }

    /**
     * 新增员工
     *
     * @param barbers 员工
     * @return 结果
     */
    @Override
    public int insertBarbers(Barbers barbers)
    {
        return barbersMapper.insertBarbers(barbers);
    }

    /**
     * 修改员工
     *
     * @param barbers 员工
     * @return 结果
     */
    @Override
    public int updateBarbers(Barbers barbers)
    {
        return barbersMapper.updateBarbers(barbers);
    }

    /**
     * 批量删除员工
     *
     * @param barberIDs 需要删除的员工主键
     * @return 结果
     */
    @Override
    public int deleteBarbersByBarberIDs(Long[] barberIDs)
    {
        return barbersMapper.deleteBarbersByBarberIDs(barberIDs);
    }

    /**
     * 删除员工信息
     *
     * @param barberID 员工主键
     * @return 结果
     */
    @Override
    public int deleteBarbersByBarberID(Long barberID)
    {
        return barbersMapper.deleteBarbersByBarberID(barberID);
    }
}
